﻿
@{
    ViewBag.Title = "Quản lý bản tin RV24";
    Layout = "~/Views/Shared/_Layout.MyAccount.cshtml";
}

<h2 class="app">
	<strong>Express - Quản lý bản tin RV24</strong>
</h2>
<div class="title nomargin">
    <span class="right-btns">
        <a href="/MyAccount/ProductList/Add">Thêm mới &raquo;</a>
    </span>
    <h3>Xem các bản tin RV24</h3>
</div>
@Html.Partial("_PartialFillterBar")

<span class="paging">
    <span class="pageleft">                
        <span class="total" data-bind='text: PageText'></span>
        <span class="show ">Hiển thị <input type="text" class="text" id="pagesize" data-bind='value: PageSize, attr: {maxlength: 3}, event: { keypress: RunSomethingKey }' /> trên trang <span class="smallText" data-bind="text: PageSizeText"></span> </span>
    </span>
    <span class="pages">
        <span class="smallText" data-bind="text: PageCurrentText"></span>Trang <input type="text" class="text" id="pagecurrent" data-bind='value: CurrentPageIndex, event: { keypress: RunSomethingKey2 }' /> của <span data-bind='text: MaxPageIndex' class="totalpages"></span>
        <a href="#" data-bind="click: PrevPage, attr: {'class': PrevButtonClass}">Prev </a>
  		<a href="#" data-bind="click: NextPage, attr: {'class': NextButtonClass}">Next </a>
    </span>
</span>

<table class="tablegrid" cellspacing="0" border="0">
    <thead>
        <tr class="title">        
		    <th>
                <span class="w">
                    <a href="#" data-bind='click: function(event) { SetOrder(event, "Title")}'>Tên bản tin RV24</a>
                    <div class="sort_wrapper" id="Title">  
                        <span class="grid_order ui_icon"></span>
                    </div>               
                </span>
            </th>   
		    <th class="ordered">
                <span class="w">
                    <a href="#" data-bind='click: function(event) { SetOrder(event, "Reviewed")}'>Lượt xem</a>
                    <div class="sort_wrapper" id="Reviewed">  
                        <span class="grid_order ui_icon"></span>
                    </div>               
                </span>
            </th> 
		    <th class="centeralign">
                <span class="w">
                    <a href="#" data-bind='click: function(event) { SetOrder(event, "IsSpecial")}'>Đặc biệt</a>
                    <div class="sort_wrapper" id="IsSpecial">  
                        <span class="grid_order ui_icon"></span>
                    </div>               
                </span>
            </th>
		    <th class="centeralign">
                <span class="w">
                    <a href="#" data-bind='click: function(event) { SetOrder(event, "IsTop")}'>Top</a>
                    <div class="sort_wrapper" id="IsTop">  
                        <span class="grid_order ui_icon"></span>
                    </div>               
                </span>
            </th>
		    <th class="date centeralign">
                <span class="w">
                    <a href="#" data-bind='click: function(event) { SetOrder(event, "StartDate")}'>Từ ngày</a>
                    <div class="sort_wrapper" id="StartDate">  
                        <span class="grid_order ui_icon"></span>
                    </div>               
                </span>
            </th>
		    <th class="date centeralign">
                <span class="w">
                    <a href="#" data-bind='click: function(event) { SetOrder(event, "EndDate")}'>Đến ngày</a>
                    <div class="sort_wrapper" id="EndDate">  
                        <span class="grid_order ui_icon"></span>
                    </div>               
                </span>
            </th>
            <th class="datetime centeralign">
                <span class="w">
                    <a href="#" data-bind='click: function(event) { SetOrder(event, "DateCreated")}'>Ngày tạo</a>
                    <div class="sort_wrapper" id="DateCreated">  
                        <span class="grid_order ui_icon"></span>
                    </div>               
                </span>
            </th>
            <th class="status centeralign">
                <span class="w">
                    <a href="#" data-bind='click: function(event) { SetOrder(event, "Approved")}'>Kích hoạt</a>
                    <div class="sort_wrapper" id="Approved">  
                        <span class="grid_order ui_icon"></span>
                    </div>               
                </span>
            </th>
		    <th class="last status centeralign"><span class="w">Tình trạng</span></th>
        </tr>
    </thead>
    <tbody data-bind="foreach: Products">
        <tr class="line" data-bind="attr: {'class': Approved? 'line': 'line new'}">
		    <td>
                <span class="w">
                    <a data-bind='text: Title, attr: {href: "/MyAccount/ProductList/Edit/" + ID}'>Edit</a>
                </span>
            </td>
		    <td class="rightalign">
                <span class="w red" data-bind='text: Reviewed'>
                </span>
            </td>
            <td class="active centeralign">
                <span class="w">
                    <input type="checkbox" name="active" disabled="disabled" data-bind="checked: IsSpecial" />
                </span>
            </td>
            <td class="active centeralign">
                <span class="w">
                    <input type="checkbox" name="active" disabled="disabled" data-bind="checked: IsTop" />
                </span>
            </td>
		    <td class="date centeralign">
                <span class="w" data-bind='text: Start'>
                </span>
            </td>
		    <td class="date centeralign">
                <span class="w" data-bind='text: End'>
                </span>
            </td>
		    <td class="datetime centeralign">
                <span class="w" data-bind='text: CreationDate'>
                </span>
            </td>
            <td class="active centeralign">
                <span class="w">
                    <input type="checkbox" name="active" disabled="disabled" data-bind="checked: Approved" />
                </span>
            </td>
		    <td class="last status centeralign">
                <span class="w" data-bind="text: ProductState">
                </span>
            </td>
	    </tr>
    </tbody>
</table>

<div id="progress" class="loading">Loading...</div>

@Html.Partial("_PopupConfirmDeleted")
<script type="text/javascript">
    var data = @(Html.Raw(Json.Encode(Model)));
</script>
<script src="/Scripts/Lib/ProductGrid.js" type="text/javascript"></script>
<script src="/Scripts/common.stringUtil.js" type="text/javascript"></script>
<script src="/Scripts/DoT.js" type="text/javascript"></script>
<script src="/Scripts/Lib/ProductListFilters.js" type="text/javascript"></script>